/************************************************************************************************
 * test examples of 100 interesting program in C
 * test 012_1.c
 * Lorry Number Construction
 ***********************************************************************************************/

#include <stdio.h>
#include <math.h>

/*
 *
 */

int main()
{
	int i = 0, j = 0;
	int k = 0, c = 0;
	for (i = 0; i <= 9; i++)
	{
		for (j = 0; j <= 9; j++)
		{
			if (i != j)
			{
				k = i*1000 + i*100 + j*10 + j;
				c = sqrt(k);
				if (c*c == k)
					printf("Lorry No. is %d\n", k);
			}
		}
	}

	for (i = 1; i < 100; i++)
	{
		k = i*i;
		if ((k/1000 != k%10) && (k/1000 == (k%1000)/100) && (k%100)/10 == k%10)
			printf("Lorry No. is: %d\n", k);
	}
}

